#!/bin/bash


read -p "Enter new password of root user: " password

if [ ! -n "$password" ]; then
    password="qwer9876"
fi

initmysql=`
mysql <<EOF
use mysql;
update user set authentication_string=PASSWORD('${password}') where User='root'; 
update user set plugin="mysql_native_password"; 
flush privileges;
EOF
`

echo $initmysql